﻿using System;
using System.IO;
using RIABlog.Web.Helpers;
using RIABlog.Web.Resources;

namespace RIABlog.Web.Models
{
	public class ModerateCommand : BaseCommand
	{
		#region Overrides of BaseCommand

		public override string Hint
		{
            get { return CommandResources.ModerateCommandHint; }
        }

		public override string RelativeImageUrl
		{
			get { return "bomb.png"; }
		}

		public override int OrderPos 
		{
			get { return 3; }
		}

		internal override string Execute(Guid blogPostId)
		{
			var folderInfo = new DirectoryInfo(EntityExtensions.GetExistingBlogPostFolder(blogPostId));
			var titleAndId = folderInfo.Name.Split(EntityExtensions.NameSeparator);

            return string.Format(CommandResources.ModerateCommandResult, titleAndId[0]);
        }

		#endregion
	}
}